import 'raf/polyfill';

import React, { Component } from 'react';
import ReactDom from 'react-dom';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import { Provider } from 'react-redux';
import store from './stores';

import A from './pages/A';
import B from './pages/B';
import Todo from './pages/todo/TodoList';

import { ConfigProvider, Input } from 'antd';
// 由于 antd 组件的默认文案是英文，所以需要修改为中文
import zhCN from 'antd/es/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
import 'antd/dist/antd.css';

moment.locale('zh-cn');



class App extends Component {
	state = {
		content: 'vvv'
	};

	handleChange = (e) => {
		this.setState({
			content: e.target.value
		})
	}
    render() {
		return (
			<Router>
				<div className="App">
					<Route path='/todo' component={Todo}></Route>
					<Route path='/a' component={A}></Route>
					<Route path='/b' component={B}></Route>
					<ConfigProvider locale={zhCN}>
						<div>
							<div>
								<Input
									onChange={this.handleChange}
									placeholder="请输入" 
									style={{ width: '50%' }}/>
							</div>
							<div>
								内容为：{this.state.content ? this.state.content : '未填写'}
							</div>
						</div>
						
					</ConfigProvider>
				</div>
			</Router>
		);
    }
}
ReactDom.render(
    <Provider store={store}>
        <App/>
    </Provider>, 
    document.getElementById('root')
);

  
  